/*
	api文件
 */
import ajaxRequest from '../ajax/index.js';
/**
 * 用户
 * */
export const systemAuthListLeftMenus = function(params) { return ajaxRequest('system/auth/list-left-menus', params, 'get')}; // 获取菜单权限
export const frameUserDetail = function(params) { return ajaxRequest('frame/user/detail', params)}; // 用户详情
export const frameUserSave = function(params) { return ajaxRequest('frame/user/save', params)}; // 用户详情
export const frameUserLogin = function(params) { return ajaxRequest('system/auth/login', params)};
export const homeMyInfo = function(params) { return ajaxRequest('home/myInfo', params)};
export const frameUserMyInfo = function(params) { return ajaxRequest('frame/user/myInfo', params)};
export const empList = function(params) { return ajaxRequest('emp/list', params)};
export const processList = function(params) { return ajaxRequest('process/list', params)};
export const systemPlatformCustomerGetIdByName = function(params) { return ajaxRequest('system/platform-customer/get-id-by-name', params, 'get')};
export const systemAuthGetPermissionInfo = function(params) { return ajaxRequest('system/auth/get-permission-info', params, 'get')};
// 设备监控
export const machineManagerMachineGetRunState = (val) => ajaxRequest('machinemanager/machine/get-run-state', val, 'get');
export const reportMachineStateInfo = (params) => ajaxRequest('report/machine/state-info', params, 'get');
// 获取用户所属车间
export const userDataWorkshops = function(params) { return ajaxRequest('userData/workshops', params)};
export const systemNoticeShow = (data) => ajaxRequest('/system/notice/show', data, 'get');

/**
 * 员工*/
export const systemEmpPage = (val) => ajaxRequest('system/emp/page', val, 'get');

/**
 * 开台*/
export const productionPrdNoticeMachineChangePage = (params) => ajaxRequest('production/prd-notice-machine-change/page', params, 'get');
export const productionPrdNoticeMachineClearOpeningOpening = (data, params) => ajaxRequest('production/prd-notice-machine-opening/clear-opening', data, 'post', params);
export const prdNoticeMachineChangeList = function(params) { return ajaxRequest('prdNoticeMachineChange/list', params)};
// 开台-详情
// 纱管颜色 粗纱：{ auditState: 3, typeCode: "002" } 细纱：{ auditState: 3, typeCode: "001" }
export const tubeColorList = function(params) { return ajaxRequest('tubeColor/list', params)};
export const spinTubeColorPage = (params) => ajaxRequest('spin/tube-color/page', params, 'get');

export const workforcemanagementScheduleShiftByTime = (params) => ajaxRequest('workforcemanagement/schedule-shift/by-time', params, 'get');
export const productionPrdNoticeMachineChangeGet = (params) => ajaxRequest('production/prd-notice-machine-change/get', params, 'get');
export const productionPrdNoticeMachineChangeGetMachineData = (params) => ajaxRequest('production/prd-notice-machine-change/getMachineData', params, 'get');
export const productionPrdNoticeMachineOpeningOpening = (params) => ajaxRequest('production/prd-notice-machine-opening/opening', params);
export const productionPrdNoticeMachineOpeningCompleteRenovationOpening = (data, params) => ajaxRequest('production/prd-notice-machine-change/complete-renovation-opening', data);
/**
 * 了机*/
export const prdNoticeMachineFinishList = function(params) { return ajaxRequest('prdNoticeMachineFinish/list', params)};
export const prdNoticeMachineFinishFinishDetail = function(params) { return ajaxRequest('prdNoticeMachineFinish/finishDetail', params)};
export const prdNoticeMachineOpeningFinishSave = function(params) { return ajaxRequest('prdNoticeMachineOpening/finishSave', params)};
export const productionPrdNoticeMachineCloseClose = (params) => ajaxRequest('production/prd-notice-machine-close/close', params);

/**
 * 故障呼叫*/
export const machineListWithSpinningProduct = function(params) { return ajaxRequest('machine/listWithSpinningProduct', params)};
export const spinFaultTypePage = function(params) { return ajaxRequest('spin/fault-type/page', params, 'get')};
export const spinFaultPage = function(params) { return ajaxRequest('spin/fault/page', params, 'get')};
export const repairOrderSave = function(params) { return ajaxRequest('machinemanager/repair-order/create', params)};
export const repairOrderList = function(params) { return ajaxRequest('machinemanager/repair-order/page', params, 'get')};
export const machineManagerRepairOrderGet = function(params) { return ajaxRequest('machinemanager/repair-order/get', params, 'get')};
export const spinFaultCausePage = function(params) { return ajaxRequest('spin/fault-cause/page', params, 'get')};
export const repairOrderTake = function(params) { return ajaxRequest('repairOrder/take', params)};
export const machineManagerRepairOrderComplete = (data) => ajaxRequest('machinemanager/repair-order/complete', data);
export const machineManagerRepairOrderTaking = (data) => ajaxRequest('machinemanager/repair-order/taking', data);

export const machineManagerRepairOrderGetStateCount = (params) => ajaxRequest('machinemanager/repair-order/get-state-count', params, 'get');

/**
 * 人机设定
 * */
export const empListWithMachine = function(params) { return ajaxRequest('emp/listWithMachine', params)};
export const userDataGroups = function(params) { return ajaxRequest('userData/groups', params)}; // 获取用户所属班次
export const machineList = function(params) { return ajaxRequest('machine/list', params)}; // 机台列表
export const empMachineSaveWrap = function(params) { return ajaxRequest('empMachine/saveWrap', params)}; // 人机绑定的保存
/**
 * 报表
 * */
export const homePrdNoticeData = function(params) { return ajaxRequest('home/prdNoticeData', params)};
export const machineShutdownList = function(params) { return ajaxRequest('machineShutdown/list', params)};
export const machineShutdownStatistics = function(params) { return ajaxRequest('machineShutdown/statistics', params)};
export const machineShutdownShiftStatistics = function(params) { return ajaxRequest('machineShutdown/shiftStatistics', params)};
export const realtimeStatisticSpecDailyTrack = function(params) { return ajaxRequest('realtimeStatistic/specDailyTrack', params)};
export const reportFrontSpinningMbMonthData = (data) => ajaxRequest('report/front/spinning/mb/month/data', data, 'get');
export const customStatisticSpecSheetList = function(params) { return ajaxRequest('customStatistic/specSheetList', params)};
export const statisticOutputElectricEnergy = function(params) { return ajaxRequest('statistic/outputElectricEnergy', params)};
export const statisticMachineOutput = function(params) { return ajaxRequest('statistic/machineOutput', params)};
export const reportAfterSpinningMonthData = (params) => ajaxRequest('report/after/spinning/month/data', params, 'get');
export const spinWorkshopAreaPage = (params) => ajaxRequest('/spin/workshop-area/page', params, 'get');
export const iotCollectDataLtPage = (params) => ajaxRequest('/iot/collect-data/lt-page', params, 'get');
// 络筒人员工资月报表
export const spinReportLtGroupYieldReportMonth = (params) => ajaxRequest('/spinreport/lt-group-yield/report/month', params, 'get');
// 细纱班组工资月报表
export const spinReportAfterPlanGroupYieldReportMonth = (params) => ajaxRequest('/spinreport/after-plan-group-yield/report/month', params, 'get');
// 前纺班组工资月报表
export const spinReportFrontPlanGroupYieldTwoReportMonth = (params) => ajaxRequest('/spinreport/front-plan-group-yield-two/report/month', params, 'get');
export const iotCollectDataCountPage = (params) => ajaxRequest('/iot/collect-data/count-page', params, 'get');
// 前纺班组产量统计
export const machineSpinReportFrontPlanGroupYieldPageTwo = (params) => ajaxRequest('/spinreport/front-plan-group-yield-two/page', params, 'get');
export const spinReportAfterPlanGroupYieldPage = (params) => ajaxRequest('/spinreport/after-plan-group-yield/page', params, 'get');
export const spinReportLtGroupYieldPage = (params) => ajaxRequest('/spinreport/lt-group-yield/page', params, 'get');
export const productionLineDayData = (params) => ajaxRequest('/production/line/day/data', params, 'get');

/**
 * 看板
 * */
export const xsDataShowDayTotal = function(params) { return ajaxRequest('xsDataShow/dayTotal', params)};
/**
 * 翻改任务
 * */
export const prdNoticeListUsedToChange = function(params) { return ajaxRequest('prdNotice/listUsedToChange', params)};
export const prdNoticeMachineListWithChangeProduct = function(params) { return ajaxRequest('prdNoticeMachine/listWithChangeProduct', params)};
export const prdNoticeMachineChangeSaveWrap = function(params) { return ajaxRequest('prdNoticeMachineChange/saveWrap', params)};

/**
 * 工序
 * */
export const spinProcessPage = (params) => ajaxRequest('spin/process/page', params, 'get');

/**络筒管理*/
export const productionPrdNoticeLtMachineChangeGetMachineList = (params) => ajaxRequest('production/prd-notice-lt-machine-change/get-machine-list', params, 'get');
export const productionPrdNoticeLtMachineChangeCreate = (params) => ajaxRequest('production/prd-notice-lt-machine-change/create', params);
export const productionPrdNoticeLtMachineChangeCreateBatch = (params) => ajaxRequest('production/prd-notice-lt-machine-change/create-batch', params);
export const productionPrdNoticeLtMachineChangeOpening = (params) => ajaxRequest('production/prd-notice-lt-machine-change/opening', params);// 开台
export const productionPrdNoticeLtMachineChangeClose = (params) => ajaxRequest('production/prd-notice-lt-machine-change/close', params);
export const productionPrdNoticeLtMachineChangeClearOpening = (query, params) => ajaxRequest('production/prd-notice-lt-machine-change/clear-opening', query, 'post', params);// 取消开台

/**细纱通知单*/
export const productionPrdNoticePage = (params) => ajaxRequest('production/prd-notice/page', params, 'get');
export const productionPrdNoticeGet = (params) => ajaxRequest('production/prd-notice/get', params, 'get');
export const productionPrdOrderBatchGet = (params) => ajaxRequest('production/prd-order/batch/get', params, 'get');
export const productionPrdOrderBatchUpdate = (params) => ajaxRequest('production/prd-order/batch/update', params, 'put');
export const productionPrdNoticeUpdatePackageState = (params) => ajaxRequest('production/prd-notice/update-package-state', params);

/**排班管理*/
export const workforcemanagementScheduleList = (params) => ajaxRequest('workforcemanagement/schedule/list', params, 'get');
export const workforcemanagementScheduleGroupList = (params) => ajaxRequest('workforcemanagement/schedule-group/list', params, 'get');
export const workforceManagementScheduleEmpMachineMy = (params) => ajaxRequest('workforcemanagement/schedule-emp-machine/my', params, 'get'); // 获取当前员工的排产机台

// 设备
export const machinemanagerMachineGet = (params) => ajaxRequest('machinemanager/machine/get', params, 'get');
export const machineManagerMachinePage = (params) => ajaxRequest('machinemanager/machine/page', params, 'get');
export const workforcemanagementScheduleGroupUpdate = (params) => ajaxRequest('workforcemanagement/schedule-group/update', params, 'put');
export const workforcemanagementScheduleGroupDeleteEmp = (params, data) => ajaxRequest('workforcemanagement/schedule-group/delete-emp', params, 'delete', data);

export const workforcemanagementScheduleEmpMachineCreate = (params) => ajaxRequest('workforcemanagement/schedule-emp-machine/create', params);
export const workforcemanagementScheduleEmpMachineDelete = (params, data) => ajaxRequest('workforcemanagement/schedule-emp-machine/delete', params, 'delete', data);
export const workforcemanagementEmpMachinePage = (params) => ajaxRequest('workforcemanagement/emp-machine/page', params, 'get');
export const personnelGroupPage = (params) => ajaxRequest('personnel/group/page', params, 'get');
export const workforcemanagementScheduleEmpMachineUpdate = (data) => ajaxRequest('workforcemanagement/schedule-emp-machine/update', data);

export const machineManagerMachineSpinGroupCreate = (data) => ajaxRequest('machinemanager/machine/spin/group/create', data);
export const machineManagerMachineSpinGroupUpdate = (data) => ajaxRequest('machinemanager/machine/spin/group/update', data, 'put');
export const machineManagerMachineSpinGroupDelete = (data, query) => ajaxRequest('machinemanager/machine/spin/group/delete', data, 'delete', query);

/**
 * 包装计划*/
export const productionPackagePlanGet = (params) => ajaxRequest('production/prd-packing-plan/get', params, 'get');
export const productionPackagePlanPage = (params) => ajaxRequest('production/prd-packing-plan/page', params, 'get');
export const yongYouWarehouseList = (params) => ajaxRequest('yongyou/warehouse/list', params, 'get');
export const yongYouInventoryProductStockList = (params) => ajaxRequest('yongyou/inventory-product-stock/list', params, 'get');
export const productionStockRecordCreate = (params) => ajaxRequest('production/stock-record/create', params, 'post');
export const productionStockRecordUpdate = (params) => ajaxRequest('production/stock-record/update', params, 'put');
export const productionStockRecordGet = (params) => ajaxRequest('production/stock-record/get', params, 'get');
export const productionStockRecordPage = (params) => ajaxRequest('production/stock-record/page', params, 'get');
export const yongYouInventoryProductStockTotal = (params) => ajaxRequest('yongyou/inventory-product-stock/total', params, 'get');
export const productionStockRecordUpdateAuditState = (params) => ajaxRequest('production/stock-record/update-audit-state', params);
export const productionPrdNoticeNewPage = (params) => ajaxRequest('/production/prd-notice/new-page', params, 'get');
/**
 * 出库*/
export const productionStockOutRecordCreate = (params) => ajaxRequest('production/stock-out-record/create', params);
export const productionStockOutRecordUpdate = (params) => ajaxRequest('production/stock-out-record/update', params, 'put');
export const productionStockOutRecordPage = (params) => ajaxRequest('production/stock-out-record/page', params, 'get');
export const productionStockOutRecordGet = (params) => ajaxRequest('production/stock-out-record/get', params, 'get');
export const productionStockOutRecordDelete = (query) => ajaxRequest('production/stock-out-record/delete', {}, 'delete', query);
export const spinCustomerPage = (params) => ajaxRequest('spin/customer/page', params, 'get');
export const productionStockOutRecordUpdateAuditState = (params) => ajaxRequest('production/stock-out-record/update-audit-state', params);

/**
 * 调拨单*/
export const productionStockTransferRecordCreate = (params) => ajaxRequest('production/stock-transfer-record/create', params);
export const productionStockTransferRecordUpdate = (params) => ajaxRequest('production/stock-transfer-record/update', params, 'put');
export const productionStockTransferRecordPage = (params) => ajaxRequest('production/stock-transfer-record/page', params, 'get');
export const productionStockTransferRecordGet = (params) => ajaxRequest('production/stock-transfer-record/get', params, 'get');
export const productionStockTransferRecordDelete = (query) => ajaxRequest('production/stock-transfer-record/delete', {}, 'delete', query);
export const productionStockTransferRecordUpdateAuditState = (params) => ajaxRequest('production/stock-transfer-record/update-audit-state', params);

// 工艺
export const spinSpecSheetTaskPage = (params) => ajaxRequest('spin/spec-sheet-task/page', params, 'get');

/**
 * 生产看板*/
export const reportProductionHomeData = (params) => ajaxRequest('report/production/home/data', params, 'get');
export const reportProductionHomeDataProductCurrentShiftYield = (params) => ajaxRequest('report/production/home/data/product-current-shift-yield', params, 'get');

export const reportProductionOrderTracking = (params) => ajaxRequest('report/production/order/tracking', params, 'get');
export const reportProductionHomeDataMachineYieldTop = (params) => ajaxRequest('report/production/home/data/machine-yield-top', params, 'get');
export const reportProductionOrderTrackingCount = (params) => ajaxRequest('/report/production/order/tracking-count', params, 'get');

// 机台停机时长排行
export const reportProductionHomeDataMachineStopTimeTop = (params) => ajaxRequest('report/production/home/data/machine-stop-time-top', params, 'get');
// 机台效率排行
export const reportProductionHomeDataMachineRunningEfficiencyTop = (params) => ajaxRequest('/report/production/home/data/machine-running-efficiency-top', params, 'get');
export const machineManagerMachineGetHumiture = (params) => ajaxRequest('/machinemanager/machine/get-humiture', params, 'get');

/**
 * 微信登录*/

// 获取openId
export const wxWxAuthCodeToOpenid = (params) => ajaxRequest('wx/wxAuth/codeToOpenid', params, 'post');
// 免登录 参数: openId
export const systemAuthWxLogin = (params) => ajaxRequest('system/auth/wx-login', params, 'post');
// 解除微信绑定
export const systemAuthWxUntie = (params) => ajaxRequest('system/auth/wx-untie', params, 'post');

// 获取列名配置
export const systemUserColumnConfigGet = (params, headers, query) => ajaxRequest('/system/user/column-config/get', params, 'get', query);
export const getMachineDetail = (params) => ajaxRequest('report/production/order/machine-run-state',params,'post')
// 前纺看板
export const getProductionSignage= (params) => ajaxRequest(`report/production/order/machine/group/list`, params ,'get')
export const getWorkingSchedule = (params) => ajaxRequest('workforcemanagement/schedule-group/get-group',params,'get')
export const reportProductionOrderMachineGroupList = (params) => ajaxRequest('/report/production/order/machine/group/list', params, 'get');
export const workforceManagementScheduleGroupGetGroup = (params) => ajaxRequest('/workforcemanagement/schedule-group/get-group', params, 'get');
export const workforceManagementScheduleGroupPostList = (params) => ajaxRequest('/workforcemanagement/schedule-group/post-list', params, 'get');
export const reportProductionOrderMachineGroupNoEmpList = (params) => ajaxRequest('/report/production/order/machine/group/no-emp/list', params, 'get');
